package com.hesicare.untils.sginutils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.imageio.stream.FileImageOutputStream;
import java.io.File;

/**
 * @Author 55097
 * @create 2022/1/4 12:30
 */
public class sginUtil {


    protected final static Logger log = LoggerFactory.getLogger(sginUtil.class);

    public static void byte2image(byte[] data, String path, String fileName) {
        try {
            FileImageOutputStream imageOutput = new FileImageOutputStream(new File(path + "/" + fileName + ".png"));
            imageOutput.write(data, 0, data.length);
            imageOutput.close();
        } catch (Exception ex) {
            log.error("保存电子签名错误{}", ex);
        }
    }
}
